import {
  Column,
  CreateDateColumn,
  Entity,
  PrimaryGeneratedColumn,
  UpdateDateColumn,
} from 'typeorm';

@Entity({ name: 'tb_organizations' })
export class Organization {
  @PrimaryGeneratedColumn({
    type: 'int',
    name: 'organization_id',
    comment: '组织ID',
  })
  organizationId: number;

  @Column('varchar', {
    name: 'organization_name',
    length: 128,
    comment: '组织名称',
  })
  organizationName: string;

  @Column('varchar', {
    name: 'org_short_name',
    length: 64,
    comment: '组织简称',
  })
  orgShortName: string;

  @Column('varchar', {
    name: 'organization_code',
    length: 64,
    comment: '组织编码',
  })
  organizationCode: string;

  @UpdateDateColumn({
    name: 'updated_at',
    type: 'timestamp',
    comment: '最后一次更新时间',
  })
  updatedAt: number;

  @CreateDateColumn({
    name: 'created_at',
    type: 'timestamp',
    comment: '创建时间',
  })
  createdAt: number;
}
